// load the module
var page = require('webpage').create();
var tabUrl = "https://detail.tmall.com/item.htm?id=545061345197&ali_trackid=17_dac701db6218e1377b2d09486ba66d62&spm=a21bo.50862.201862-3.1.47An6l";

function onPageReady() {
    var htmlContent = page.evaluate(function () {
        return document.body.innerHTML;
    });

    console.log(htmlContent);

    phantom.exit();
}

page.open(tabUrl, function (status) {
    function checkReadyState() {
        setTimeout(function () {
            var readyState = page.evaluate(function () {
                return document.readyState;
            });

            if ("complete" === readyState) {
                onPageReady();
                page.render('newtaobao.png');
            } else {
                checkReadyState();
            }
        });
    }

    checkReadyState();
});